# Scrapy settings for post_data project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = "post_data"

SPIDER_MODULES = ["post_data.spiders"]
NEWSPIDER_MODULE = "post_data.spiders"


# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = "post_data (+http://www.yourdomain.com)"

LOG_LEVEL = "ERROR"
# Obey robots.txt rules
ROBOTSTXT_OBEY = False

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
COOKIES_ENABLED = False        # 不使用scrapy封装的cookies

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
DEFAULT_REQUEST_HEADERS = {
    'Accept': '*/*',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Acs-Token': '1696486770765_1696486771702_9no6kJDvtRzyD7/StjfVFzoKd+DsyrIBGyambYVsJ0XIvwoQeUwOrdzbrXt5wiCj3tlu1yFJVw0eo6rq3O2DYGIukQZ4RcNdIHXy8NK+unY5XyV+9LyPphnufrkFotfE+5J4TeL477JIB91/p0SqVasm8/3vzHNVnYM8Jx1uGIH20N4SVlnItYKaEEC5/fK4FqUUz2EZOM951WPjSi7rmbdjIT9jn4hjFWXPMeXTYVg0iQiWzw9LEtYw/ToklM0P+1jJVtwPj2bRRVuyiALtHR8KvC6yiSO3dMHkH9ydInAGY3zFyR97XGJvI6i8lfZEkRHiLZKHlNaR77JBHqUxNheJ7mlKuUeMZ7FhD6UHOArEfLHf9mRwSFsTSNo2Lw7CPI4whWTqxyaSR2+VnaDTPK5mjFukRPywYn4y+qbUw3dbBqQDWZLQ9qrU7WeDJB/L/1gFchTACvlcON9UNU6CiNV5KNX9KvtDXCkZQyeTg1ucb55+MsdGEf66QvxBny26',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Content-Length': '147',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Cookie': 'BAIDUID=41B7D0E7FD164B7DC20D7AF82EFEAEA5:FG=1; H_WISE_SIDS=219946_131862_216837_213354_214805_219942_213039_204915_110085_236308_243886_244476_244718_240590_245412_247148_250889_251428_249892_254592_253426_255981_256083_255661_254835_256739_251973_256620_257081_257102_254075_257289_254317_251058_257661_257936_257167_257904_257823_257586_253900_258253_257994_255224_258376_227147_258723_258728_258938_257302_258985_258958_258694_230288_259047_257016_107316_252256_259191_259193_259277_256223_259403_259286_259391_259431_259536_228132_259569_259605_259628_259581_256998_259558_259653_258773_234296_234208_259888_259642_255909_260045_254300_260125_259958_260235_256229_260355_260390_260362_259187_260457_253022_255212_260569_258081_260334_259408_260651_260352_251786_253676_260834_259312_259422_259583_260718_260976_260938_259031; BIDUPSID=41B7D0E7FD164B7DC20D7AF82EFEAEA5; PSTM=1684829720; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; H_WISE_SIDS_BFESS=219946_131862_216837_213354_214805_219942_213039_204915_110085_236308_243886_244476_244718_240590_245412_247148_250889_251428_249892_254592_253426_255981_256083_255661_254835_256739_251973_256620_257081_257102_254075_257289_254317_251058_257661_257936_257167_257904_257823_257586_253900_258253_257994_255224_258376_227147_258723_258728_258938_257302_258985_258958_258694_230288_259047_257016_107316_252256_259191_259193_259277_256223_259403_259286_259391_259431_259536_228132_259569_259605_259628_259581_256998_259558_259653_258773_234296_234208_259888_259642_255909_260045_254300_260125_259958_260235_256229_260355_260390_260362_259187_260457_253022_255212_260569_258081_260334_259408_260651_260352_251786_253676_260834_259312_259422_259583_260718_260976_260938_259031; APPGUIDE_10_6_2=1; APPGUIDE_10_6_5=1; MCITY=-%3A; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; BA_HECTOR=04248k842105210h2h85a5aq1ihqr601o; ZFY=o:BqOmgSMiP0dt9N1AFVKCa3VB0rMLFbcJ5cbjeo8DYY:C; BAIDUID_BFESS=41B7D0E7FD164B7DC20D7AF82EFEAEA5:FG=1; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1696427211,1696427257,1696428499,1696486739; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1696486771; ab_sr=1.0.1_ZGU4YzE1Zjk2MGQzZDRmMWNkZjA2MTMzMDQ0Y2YwNGRhZjA4YmM1ZGQzMzIzNTRiYjczNThlNTk4NWEyMzk4NjFhNzkzZmU5OTlkYWZmZTY2ZjJkM2I1OWYxZDRmMDg2OWVlYWI5ODQxY2I1NDMwNGNhNThjZWQ5MjA0ZWFhOTk3MzUxNTU3NjU1NmU1YzcwYTVhZTJlNTE1MTJlNjFjZQ==',
    'Host': 'fanyi.baidu.com',
    'Origin': 'https://fanyi.baidu.com',
    'Pragma': 'no-cache',
    'Referer': 'https://fanyi.baidu.com/',
    'Sec-Ch-Ua': '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',
    'Sec-Ch-Ua-Mobile': '?0',
    'Sec-Ch-Ua-Platform': '"Windows"',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest',
}

# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    "post_data.middlewares.PostDataSpiderMiddleware": 543,
#}

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
#    "post_data.middlewares.PostDataDownloaderMiddleware": 543,
#}

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    "scrapy.extensions.telnet.TelnetConsole": None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
#    "post_data.pipelines.PostDataPipeline": 300,
#}

# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = "httpcache"
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = "scrapy.extensions.httpcache.FilesystemCacheStorage"

# Set settings whose default value is deprecated to a future-proof value
REQUEST_FINGERPRINTER_IMPLEMENTATION = "2.7"
TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
FEED_EXPORT_ENCODING = "utf-8"
